package cn.yl.order.server.service.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * @author hyl
 */
@FeignClient("edu-course-boot") // 参数 serviceId
public interface CourseFeignService {
    /**
     * @param courseId 课程id
     * @return  courseId price discounts
     */
    @GetMapping("/course/getCourseById")
    Map<String ,Object> getCourseById(@RequestParam Integer courseId);

    /**
     * @param courseId courseId is to add sales +1
     */
    @PutMapping("{courseId}")
    void updateSalesByCourseId(@PathVariable Integer courseId);

}
